/*-----Control Point Dialog-----------------*/
function showControlPointDialog(parentObjId) {
	$.ajax({
		type:"post",
		url:"ajaxShowControlPointDialog.do",
		success:function(msg){
			$("#dialog").html(msg);
			$("#dialog").dialog({
				autoOpen: true,
				width: 800,
				title:$("#controlPointDialog").attr("title"),
				modal: true,
				buttons: [
					{
						text: "确定",
						click: function() {
							$("#rightControlPoints tbody tr").removeClass("ui-state-active");
							$("#" + parentObjId +" tbody").html($("#rightControlPoints tbody").html());
							$("#" + parentObjId +" tbody tr").attr("onclick","");
							setTableCSS(parentObjId);
							$( this ).dialog( "close" );
						}
					},
					{
						text: "取消",
						click: function() {
							$( this ).dialog( "close" );
						}
					}
				]
			});
			$("#rightControlPoints tbody").html($("#" + parentObjId +" tbody").html());
			$("#rightControlPoints tbody tr").attr("onclick","clickSelect(this)");
			findControlPointListForSelect();
		}
	});
}

function findControlPointListForSelect() {
	$.ajax({
		type:"post",
		url: "ajaxFindControlPointListForSelect.do",
		data:{strParam1:$("#txtControlPointName").val(),strParam2:$("#sltCPDRoadSection").val()},
		success:function(msg){
			$("#leftControlPoints").replaceWith(msg);
		}
	});
}

/*-----Inform Rule Dialog-----------------*/
function showInformRuleDialog(parentObjId){
	$.ajax({
		type:"post",
		url:"ajaxShowInformRuleDialog.do",
		success:function(msg){
			$("#dialog").html(msg);
			$("#dialog").dialog({
				autoOpen: true,
				width: 800,
				title:$("#InformRuleDialog").attr("title"),
				modal: true,
				buttons: [
					{
						text: "确定",
						click: function() {
							$("#rightInformRule tbody tr").removeClass("ui-state-active");
							$("#" + parentObjId +" tbody").html($("#rightInformRule tbody").html());
							$("#" + parentObjId +" tbody tr").attr("onclick","");
							setTableCSS(parentObjId);
							$( this ).dialog( "close" );
						}
					},
					{
						text: "取消",
						click: function() {
							$( this ).dialog( "close" );
						}
					}
				]
			});
			$("#rightInformRule tbody").html($("#" + parentObjId +" tbody").html());
			$("#rightInformRule tbody tr").attr("onclick","clickSelect(this)");
			findInformRuleForSelect();
		}
	});
}
function findInformRuleForSelect(){
	$.ajax({
		type:"post",
		url: "ajaxFindInformRuleSelectList.do",
		data:{strParam1:$("#txtInfromRuleName").val()},
		success:function(msg){
			$("#leftInformRule").replaceWith(msg);
		}
	});
}

/*-----Control Task Dialog-----------------*/
function showControlTaskDialog(parentObjId){
	$.ajax({
		type:"post",
		url:"ajaxShowControlTaskDialog.do",
		success:function(msg){
			$("#dialog").html(msg);
			$("#dialog").dialog({
				autoOpen: true,
				width: 800,
				title:$("#controlTaskDialog").attr("title"),
				modal: true,
				buttons: [
					{
						text: "确定",
						click: function() {
							$("#rightControlTasks tbody tr").removeClass("ui-state-active");
							$("#" + parentObjId +" tbody").html($("#rightControlTasks tbody").html());
							$("#" + parentObjId +" tbody tr").attr("onclick","");
							setTableCSS(parentObjId);
							$( this ).dialog( "close" );
						}
					},
					{
						text: "取消",
						click: function() {
							$( this ).dialog( "close" );
						}
					}
				]
			});
			$("#rightControlTasks tbody").html($("#" + parentObjId +" tbody").html());
			$("#rightControlTasks tbody tr").attr("onclick","clickSelect(this)");
			findControlTaskListForSelect();
		}
	});
}

function findControlTaskListForSelect() {
	$.ajax({
		type:"post",
		url: "ajaxFindControlTaskListForSelect.do",
		data:{strParam1:$("#txtControlTaskName").val()},
		success:function(msg){
			$("#leftControlTasks").replaceWith(msg);
		}
	});
}

/*-----Control Vehicle Dialog-----------------*/
function showControlVehicleDialog(parentObjId) {
	$.ajax({
		type:"post",
		url:"ajaxShowControlVehicleDialog.do",
		success:function(msg){
			$("#dialog").html(msg);
			$("#dialog").dialog({
				autoOpen: true,
				width: 800,
				title:$("#controlVehicleDialog").attr("title"),
				modal: true,
				buttons: [
					{
						text: "确定",
						click: function() {
							$("#rightControlVehicles tbody tr").removeClass("ui-state-active");
							$("#" + parentObjId +" tbody").html($("#rightControlVehicles tbody").html());
							$("#" + parentObjId +" tbody tr").attr("onclick","");
							setTableCSS(parentObjId);
							$( this ).dialog( "close" );
						}
					},
					{
						text: "取消",
						click: function() {
							$( this ).dialog( "close" );
						}
					}
				]
			});
			$("#rightControlVehicles tbody").html($("#" + parentObjId +" tbody").html());
			$("#rightControlVehicles tbody tr").attr("onclick","clickSelect(this)");
			findControlVehicleListForSelect();
		}
	});
}

function findControlVehicleListForSelect() {
	$.ajax({
		type:"post",
		url: "ajaxFindControlVehicleListForSelect.do",
		data:{strParam1:$("#txtHPHM").val(),strParam2:$("#sltBKLX").val(),strParam3:$("#sltHPZL").val()},
		success:function(msg){
			$("#leftControlVehicles").replaceWith(msg);
		}
	});
}

